package swu.edu.cn.javaee.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import swu.edu.cn.javaee.entity.Article;

import java.util.List;
import java.util.Map;

@Repository
public interface ArticleMapper {
    //用户新增文章
    public void saveArticle(Article article);
    //根据title查询
    public List<Article> queryArticleByTitle(String title);
    //根据作者查询
    public List<Article> queryArticleByAuthor(String author);
    //按类型查询
    public List<Article> queryArticleByTag(String tag);
    //根据文章id查询
    public Article queryArticleById(String new_id);
    //用户更新文章信息
    public void updateArticleByUser(Article article);
    //管理员对文章审核
    public void updateArticleByAdmin(Article article);
    //根据文章id删除文章
    public void deleteArticleById(String new_id);
    //查询所有文章信息
    public List<Article> queryList();
    //分页查询
    public List<Article> queryListLimit(int start,int limit);
    //查询文章数
    public Integer countArticle();
}

